import { createStore } from "vuex";
import {getList} from '../api/user'
export default createStore({
    state: {
        arrList:''
    },
    mutations: {
        // 修改arrList
        changeArrList(state,payload){
            state.arrList = payload
        }
    },
    actions: {
        // 异步请求列表数据
        async getLists({commit}){
            console.log('----');
            
            let res = await getList()
            commit('changeArrList',res.msg)
        }
    },
    modules: {

    }
});